import unittest
from test_cases import test_demo1, test_demo2

# 创建一个加载器对象,加载测试类
loader = unittest.TestLoader()

# 参数:测试类
loader1 = loader.loadTestsFromTestCase(test_demo1.DemoTestCase1)
loader2 = loader.loadTestsFromTestCase(test_demo2.DemoTestCase2)

# 创建一个测试套件,收集测试类
suite = unittest.TestSuite()
suite.addTest(loader1)
suite.addTest(loader2)

# 创建执行器
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)
